#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using GameVuTru.ManagerScreens;
using GameVuTru.GameObject;
using GameVuTru.ResourceManager;
#endregion

namespace GameVuTru.Screens
{
    class About : GameScreen
    {
        Vector2 posbtnBack = new Vector2(675, 435);
        public About()
        {
            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);
            EnabledGestures = GestureType.Tap |
                        GestureType.HorizontalDrag |
                        GestureType.Flick |
                        GestureType.Hold |
                        GestureType.VerticalDrag |
                        GestureType.FreeDrag;
        }
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
           // Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
            //Rectangle fullscreen = new Rectangle(0, 0, viewport.Width, viewport.Height);

            spriteBatch.Begin();

            spriteBatch.Draw(ReSouce.aboutScreen, new Vector2(0,0), Color.White);
            spriteBatch.Draw(ReSouce.backButton, posbtnBack, Color.White);

            spriteBatch.End();
        }
        public override void HandleInput(InputState input)
        {
            base.HandleInput(input);
            foreach (GestureSample item in input.Gestures)
            {
                if (item.GestureType == GestureType.Tap)
                {
                    Point tap = new Point((int)item.Position.X, (int)item.Position.Y);
                    if (new Rectangle((int)posbtnBack.X,(int)posbtnBack.Y,ReSouce.backButton.Width,ReSouce.backButton.Height).Contains(tap))
                    {
                        if (ManagerSound.soundOn)
                        {
                            ManagerSound.PlaySound(ReSouce.soundTap);
                        }
                        ScreenManager.RemoveScreen(this);
                        ScreenManager.AddScreen(new MainMenuScreen(),null);
                    }
                }
            }
        }
    }
}
